﻿using SqlSugar;
using System.ComponentModel.DataAnnotations.Schema;

namespace XinLife.Model
{
    [Table("tb_user")]
    [SugarTable("tb_user")]
    public class User : BaseModel
    {
        public User() { }

        public User(string loginName, string loginPWD)
        {
            cUserName = loginName;
            cPassWord = loginPWD;
            cEnabled = true;
            cCreatedDate = DateTime.Now;
            cUpdatedDate = DateTime.Now;
            cLastLoginTime = DateTime.Now;
        }
        /// <summary>
        /// 主键
        /// </summary>
        public string cUserName { get; set; }
        /// <summary>
        /// 登录密码
        /// </summary>
        public string cPassWord { get; set; }
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string cName { get; set; }
        /// <summary>
        /// 电话
        /// </summary>
        public string cTel { get; set; }
        public string cCard { get; set; }
        /// <summary>
        /// 角色名称
        /// </summary>
        public string cRoleName { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public int cGender { get; set; }
        /// <summary>
        /// 年龄
        /// </summary>
        public int cAge { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public bool cEnabled { get; set; }
        /// <summary>
        /// 备注
        /// </summary>
        public string cRemark { get; set; }
        /// <summary>
        ///最后登录时间 
        /// </summary>
        public DateTime? cLastLoginTime { get; set; }

        public string cRegionCode { get; set; }
        public string cRegionName { get; set; }


        //public virtual string[] Roles { get; set; }

        [SugarColumn(IsIgnore = true)]
        public virtual List<Role> Roles { get; set; }
    }
}
